package cn.iocoder.yudao.module.tms.dal.mysql.attachmentinfo;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.tms.dal.dataobject.attachmentinfo.AttachmentInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.tms.controller.admin.attachmentinfo.vo.*;

/**
 * 公司附件信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface AttachmentInfoMapper extends BaseMapperX<AttachmentInfoDO> {

    default PageResult<AttachmentInfoDO> selectPage(AttachmentInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AttachmentInfoDO>()
                .eqIfPresent(AttachmentInfoDO::getCompanyId, reqVO.getCompanyId())
                .eqIfPresent(AttachmentInfoDO::getAttachType, reqVO.getAttachType())
                .likeIfPresent(AttachmentInfoDO::getAttachName, reqVO.getAttachName())
                .eqIfPresent(AttachmentInfoDO::getAttachPath, reqVO.getAttachPath())
                .eqIfPresent(AttachmentInfoDO::getAttachSize, reqVO.getAttachSize())
                .eqIfPresent(AttachmentInfoDO::getAttachFormat, reqVO.getAttachFormat())
                .eqIfPresent(AttachmentInfoDO::getUploadUser, reqVO.getUploadUser())
                .betweenIfPresent(AttachmentInfoDO::getUploadDate, reqVO.getUploadDate())
                .eqIfPresent(AttachmentInfoDO::getAttachStatus, reqVO.getAttachStatus())
                .betweenIfPresent(AttachmentInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AttachmentInfoDO::getId));
    }

}